package com.atgm.mall.gmmailorder.feign;

import com.atgm.common.utils.R;
import com.atgm.mall.gmmailorder.feign.fallback.WmsFeignFallBackService;
import com.atgm.mall.gmmailorder.feign.vo.WareGameReqVo;
import com.atgm.mall.gmmailorder.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "gm-mall-ware", fallback = WmsFeignFallBackService.class, qualifier = "wmsFeignService")
public interface WmsFeignService {

    @PostMapping("/gmmallware/waresku/hasstock")
    R getSkusHasStock(@RequestBody List<Long> skuIds);

    @GetMapping("/gmmallware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);

    @PostMapping(value = "/gmmallware/waresku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockVo vo);

    /**
     * 锁定库存
     * @param wareGameReqVo
     * @return
     */
    @PostMapping("/gmmallware/waregame/lock/order")
    R lockOrder(@RequestBody WareGameReqVo wareGameReqVo);

    /**
     * 解锁订单库存
     * @param orderSn
     * @return
     */
    @GetMapping("/gmmallware/waregame/unlock/{orderSn}")
    R unlockOrder(@PathVariable("orderSn") String orderSn);
}
